package auctionatr

import grails.test.*

class TestAppTests extends GroovyTestCase {
    
	
	def can =  null
  
	def auction5
	
	def bid5
	
	protected void setUp() {
        super.setUp()
		
		
		
			can = new User(
				username:'can',
				password:'pass',
				email:'canpaul91@googlemail.com',
				birthday:(new Date() - 365*30),
				facebookName: 'admin',
				aboutUser: 'ich komme aus berlin',
				twitterName: 'hab keins :(',
				firstName: 'can',
				lastName: 'bineyti',
				street: 'allmand',
				zip: 8990,
				city: 'Stuttgart',
				accountNumber: 343443,
				bankCode: 'eee',
				role:'user',
				avatar: null,
				avatarType: null)

			can.save()
			
			if(can.hasErrors()){
				println can.errors
			}
			
			auction5 = new Auction(
				name:"Stuhl",
				description:"ich ziehe um, brauche Stuhl nicht mehr",
				startPrice:2.0,
				finishDate:(new Date()+5),
			
				category:"Baumarkt",
				shipment:"UPS",
				state:"neu",
				users: can,
				)
		auction5.save()
		
		if(auction5.hasErrors()){
			println auction5.errors
		}
		
		bid5 = new Bid(
			gebot:120.0,
			users: can,
			auctions: auction5 
			)
		bid5.save()
		if(bid5.hasErrors()){
			println bid5.errors
		}
		
			
			
		}
		
				
    

    protected void tearDown() {
        super.tearDown()
    }

    void testGebot() {
		
		
	
		
    }
}
